From: Florian Müllner Date: Fri, 1 Feb 2013 19:19:02 +0000 (+0100) Subject: volume: Suppress a critical warning X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4975 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d07c8dcd9c8dc19aa686130aaa9b65ea7b12095f;p=gnome-shell.git volume: Suppress a critical warning gvc_mixer_stream_get_port() emits a warning in the no-ports case, which we can avoid by rearranging the check for that case. https://bugzilla.gnome.org/show_bug.cgi?id=693049 --- diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index b25060cfa..8075496d3 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -169,9 +169,8 @@ const OutputStreamSlider = new Lang.Class({ // a bit hackish, but ALSA/PulseAudio have a number // of different identifiers for headphones, and I could // not find the complete list - let port = sink.get_port(); - if (port) - return port.port.indexOf('headphone') >= 0; + if (sink.get_ports().length > 0) + return sink.get_port().port.indexOf('headphone') >= 0; return false; },